package com.example.lenovo.demo.model.databean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.util.List;

/**
 * Created by Lenovo on 2017/1/14.
 */
@Table(name = "StrategyBean")
public class StrategyBean implements Parcelable{
    @Column(name="_id",isId = true)
    public int ID;
    @Column(name="category_type")
    private int category_type;
    private List<PagesBean> pages;

    protected StrategyBean(Parcel in) {
        ID = in.readInt();
        category_type = in.readInt();
        pages = in.createTypedArrayList(PagesBean.CREATOR);
    }

    public static final Creator<StrategyBean> CREATOR = new Creator<StrategyBean>() {
        @Override
        public StrategyBean createFromParcel(Parcel in) {
            return new StrategyBean(in);
        }

        @Override
        public StrategyBean[] newArray(int size) {
            return new StrategyBean[size];
        }
    };

    public int getCategory_type() {
        return category_type;
    }

    public void setCategory_type(int category_type) {
        this.category_type = category_type;
    }

    public List<PagesBean> getPages() {
        return pages;
    }

    public void setPages(List<PagesBean> pages) {
        this.pages = pages;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(ID);
        parcel.writeInt(category_type);
        parcel.writeTypedList(pages);
    }

    @Table(name = "PagesBean")
    public static class PagesBean implements Parcelable{
        @Column(name = "_id",isId = true)
        public int ID;
        @Column(name = "id")
        private int id;
        @Column(name = "title")
        private String title;
        private List<ChildrenBean> children;

        protected PagesBean(Parcel in) {
            ID = in.readInt();
            id = in.readInt();
            title = in.readString();
            children = in.createTypedArrayList(ChildrenBean.CREATOR);
        }

        public static final Creator<PagesBean> CREATOR = new Creator<PagesBean>() {
            @Override
            public PagesBean createFromParcel(Parcel in) {
                return new PagesBean(in);
            }

            @Override
            public PagesBean[] newArray(int size) {
                return new PagesBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public List<ChildrenBean> getChildren() {
            return children;
        }

        public void setChildren(List<ChildrenBean> children) {
            this.children = children;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeInt(ID);
            parcel.writeInt(id);
            parcel.writeString(title);
            parcel.writeTypedList(children);
        }

        public static class ChildrenBean implements Parcelable{
            private int id;
            private String title;
            private List<SectionsBean> sections;

            protected ChildrenBean(Parcel in) {
                id = in.readInt();
                title = in.readString();
                sections = in.createTypedArrayList(SectionsBean.CREATOR);
            }

            public static final Creator<ChildrenBean> CREATOR = new Creator<ChildrenBean>() {
                @Override
                public ChildrenBean createFromParcel(Parcel in) {
                    return new ChildrenBean(in);
                }

                @Override
                public ChildrenBean[] newArray(int size) {
                    return new ChildrenBean[size];
                }
            };

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public List<SectionsBean> getSections() {
                return sections;
            }

            public void setSections(List<SectionsBean> sections) {
                this.sections = sections;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(id);
                parcel.writeString(title);
                parcel.writeTypedList(sections);
            }

            @Table(name = "SectionsBean")
            public static class SectionsBean implements Parcelable{
                @Column(name = "_id",isId = true)
                public int ID;
                @Column(name = "description")
                private String description;
                @Column(name = "id")
                private int id;
                @Column(name = "travel_date")
                private String travel_date;
                @Column(name = "title")
                private String title;
                private UserBean user;
                private List<AttractionsBean> attractions;
                private List<PhotosBean> photos;

                protected SectionsBean(Parcel in) {
                    ID = in.readInt();
                    description = in.readString();
                    id = in.readInt();
                    travel_date = in.readString();
                    title = in.readString();
                    attractions = in.createTypedArrayList(AttractionsBean.CREATOR);
                    photos = in.createTypedArrayList(PhotosBean.CREATOR);
                }

                public static final Creator<SectionsBean> CREATOR = new Creator<SectionsBean>() {
                    @Override
                    public SectionsBean createFromParcel(Parcel in) {
                        return new SectionsBean(in);
                    }

                    @Override
                    public SectionsBean[] newArray(int size) {
                        return new SectionsBean[size];
                    }
                };

                public String getTravel_date() {
                    return travel_date;
                }

                public void setTravel_date(String travel_date) {
                    this.travel_date = travel_date;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public UserBean getUser() {
                    return user;
                }

                public void setUser(UserBean user) {
                    this.user = user;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel parcel, int i) {
                    parcel.writeInt(ID);
                    parcel.writeString(description);
                    parcel.writeInt(id);
                    parcel.writeString(travel_date);
                    parcel.writeString(title);
                    parcel.writeTypedList(attractions);
                    parcel.writeTypedList(photos);
                }

                public static class Description_user_idsBean implements Parcelable{

                    @SerializedName("153668")
                    private String value153668;
                    @SerializedName("62145")
                    private String value62145;

                    protected Description_user_idsBean(Parcel in) {
                        value153668 = in.readString();
                        value62145 = in.readString();
                    }

                    public static final Creator<Description_user_idsBean> CREATOR = new Creator<Description_user_idsBean>() {
                        @Override
                        public Description_user_idsBean createFromParcel(Parcel in) {
                            return new Description_user_idsBean(in);
                        }

                        @Override
                        public Description_user_idsBean[] newArray(int size) {
                            return new Description_user_idsBean[size];
                        }
                    };

                    public String getValue153668() {
                        return value153668;
                    }

                    public void setValue153668(String value153668) {
                        this.value153668 = value153668;
                    }

                    public String getValue62145() {
                        return value62145;
                    }

                    public void setValue62145(String value62145) {
                        this.value62145 = value62145;
                    }

                    @Override
                    public int describeContents() {
                        return 0;
                    }

                    @Override
                    public void writeToParcel(Parcel parcel, int i) {
                        parcel.writeString(value153668);
                        parcel.writeString(value62145);
                    }
                }
                public static class UserBean{

                    private int id;
                    private String name;

                    public int getId() {
                        return id;
                    }

                    public void setId(int id) {
                        this.id = id;
                    }

                    public String getName() {
                        return name;
                    }

                    public void setName(String name) {
                        this.name = name;
                    }
                }
                public List<AttractionsBean> getAttractions() {
                    return attractions;
                }

                public void setAttractions(List<AttractionsBean> attractions) {
                    this.attractions = attractions;
                }



                @Table(name = "AttractionsBean")
                public static class AttractionsBean implements Parcelable{
                    @Column(name = "_id",isId = true)
                    public int ID;
                    @Column(name="attraction_type")
                    private String attraction_type;
                    @Column(name="id")
                    private int id;
                    @Column(name="lat")
                    private String lat;
                    @Column(name="lng")
                    private String lng;
                    @Column(name="name")
                    private String name;
                    @Column(name="ctrip_id")
                    private int ctrip_id;
                    @Column(name="ctrip_url")
                    private String ctrip_url;


                    protected AttractionsBean(Parcel in) {
                        ID = in.readInt();
                        attraction_type = in.readString();
                        id = in.readInt();
                        lat = in.readString();
                        lng = in.readString();
                        name = in.readString();
                        ctrip_id = in.readInt();
                        ctrip_url = in.readString();
                    }

                    public static final Creator<AttractionsBean> CREATOR = new Creator<AttractionsBean>() {
                        @Override
                        public AttractionsBean createFromParcel(Parcel in) {
                            return new AttractionsBean(in);
                        }

                        @Override
                        public AttractionsBean[] newArray(int size) {
                            return new AttractionsBean[size];
                        }
                    };

                    public String getAttraction_type() {
                        return attraction_type;
                    }

                    public void setAttraction_type(String attraction_type) {
                        this.attraction_type = attraction_type;
                    }

                    public int getId() {
                        return id;
                    }

                    public void setId(int id) {
                        this.id = id;
                    }

                    public String getLat() {
                        return lat;
                    }

                    public void setLat(String lat) {
                        this.lat = lat;
                    }

                    public String getLng() {
                        return lng;
                    }

                    public void setLng(String lng) {
                        this.lng = lng;
                    }

                    public String getName() {
                        return name;
                    }

                    public void setName(String name) {
                        this.name = name;
                    }

                    public int getCtrip_id() {
                        return ctrip_id;
                    }

                    public void setCtrip_id(int ctrip_id) {
                        this.ctrip_id = ctrip_id;
                    }

                    public String getCtrip_url() {
                        return ctrip_url;
                    }

                    public void setCtrip_url(String ctrip_url) {
                        this.ctrip_url = ctrip_url;
                    }

                    @Override
                    public int describeContents() {
                        return 0;
                    }

                    @Override
                    public void writeToParcel(Parcel parcel, int i) {
                        parcel.writeInt(ID);
                        parcel.writeString(attraction_type);
                        parcel.writeInt(id);
                        parcel.writeString(lat);
                        parcel.writeString(lng);
                        parcel.writeString(name);
                        parcel.writeInt(ctrip_id);
                        parcel.writeString(ctrip_url);
                    }
                }

                public String getDescription() {
                    return description;
                }

                public void setDescription(String description) {
                    this.description = description;
                }

                public int getId() {
                    return id;
                }

                public void setId(int id) {
                    this.id = id;
                }

                public List<PhotosBean> getPhotos() {
                    return photos;
                }

                public void setPhotos(List<PhotosBean> photos) {
                    this.photos = photos;
                }
                @Table(name = "PhotosBean")
                public static class PhotosBean implements Parcelable{
                    @Column(name = "_id",isId = true)
                    public int ID;
                    @Column(name = "description")
                    private String description;
                    @Column(name = "image_height")
                    private int image_height;
                    @Column(name = "image_url")
                    private String image_url;
                    @Column(name = "image_width")
                    private int image_width;
                    @Column(name = "note_id")
                    private int note_id;
                    @Column(name = "trip_id")
                    private int trip_id;
                    @Column(name = "user_name")
                    private String user_name;

                    protected PhotosBean(Parcel in) {
                        ID = in.readInt();
                        description = in.readString();
                        image_height = in.readInt();
                        image_url = in.readString();
                        image_width = in.readInt();
                        note_id = in.readInt();
                        trip_id = in.readInt();
                        user_name = in.readString();
                    }

                    public static final Creator<PhotosBean> CREATOR = new Creator<PhotosBean>() {
                        @Override
                        public PhotosBean createFromParcel(Parcel in) {
                            return new PhotosBean(in);
                        }

                        @Override
                        public PhotosBean[] newArray(int size) {
                            return new PhotosBean[size];
                        }
                    };

                    public String getDescription() {
                        return description;
                    }

                    public void setDescription(String description) {
                        this.description = description;
                    }

                    public int getImage_height() {
                        return image_height;
                    }

                    public void setImage_height(int image_height) {
                        this.image_height = image_height;
                    }

                    public String getImage_url() {
                        return image_url;
                    }

                    public void setImage_url(String image_url) {
                        this.image_url = image_url;
                    }

                    public int getImage_width() {
                        return image_width;
                    }

                    public void setImage_width(int image_width) {
                        this.image_width = image_width;
                    }

                    public int getNote_id() {
                        return note_id;
                    }

                    public void setNote_id(int note_id) {
                        this.note_id = note_id;
                    }

                    public int getTrip_id() {
                        return trip_id;
                    }

                    public void setTrip_id(int trip_id) {
                        this.trip_id = trip_id;
                    }

                    public String getUser_name() {
                        return user_name;
                    }

                    public void setUser_name(String user_name) {
                        this.user_name = user_name;
                    }

                    @Override
                    public int describeContents() {
                        return 0;
                    }

                    @Override
                    public void writeToParcel(Parcel parcel, int i) {
                        parcel.writeInt(ID);
                        parcel.writeString(description);
                        parcel.writeInt(image_height);
                        parcel.writeString(image_url);
                        parcel.writeInt(image_width);
                        parcel.writeInt(note_id);
                        parcel.writeInt(trip_id);
                        parcel.writeString(user_name);
                    }
                }
            }

        }
    }
}


